package com.box.utils.wx;

import java.io.InputStream;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import com.box.utils.Md5Util;

public class WxUtils {
	
	
	/**
	 * 通过返回IO流获取支付地址
	 * @param in
	 * @return
	 */
	public static Map<String, String> getElementValue(InputStream in){
		SAXReader reader = new SAXReader();
        Document document=null;
		try {
			document = reader.read(in);
		} catch (DocumentException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		Map<String, String> resMap=new HashMap<String, String>();

        Element root = document.getRootElement(); 
        List<Element> childElements = root.elements();
        for (Element child : childElements) {
        	String key = child.getName();
        	String value = child.getStringValue();    
        	resMap.put("key",key);
        	resMap.put("value", value);
        	
        }
       return resMap;
   
 
	}
	
	


}
